package com.abocode.aichat.getway.handler;

import com.abocode.aichat.server.context.ServerRuntimeContext;
import com.abocode.aichat.server.handler.ServerInboundHandler;
import com.abocode.aichat.server.worker.Worker;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;

/**
 * Created by franky-12.
 *
 * */
@ChannelHandler.Sharable
public class GatewayServerInboundHandler extends ServerInboundHandler {
    public GatewayServerInboundHandler(ServerRuntimeContext serverRuntimeContext) {
        super(serverRuntimeContext);
    }
    public GatewayServerInboundHandler(ServerRuntimeContext serverRuntimeContext, Worker worker) {
        super(serverRuntimeContext, worker);
    }
    public void registerChannel(Channel channel) {
        serverRuntimeContext.getGatewayChannelRegistry().register(channel);
    }

    public void unRegisterChannel(Channel channel) {
        serverRuntimeContext.getGatewayChannelRegistry().unregister(channel);
    }

}
